#ifndef STEAM_OUT_H
#define STEAM_OUT_H

#include "mytype.h"
#include "str_ext.h"

#ifdef __cplusplus
extern "C"
{
#endif

    typedef struct
    {
        int buff_size;                    
        int buff_used;                    
        char *buff;                       
        void (*out)(char *data, int len); 
        int len;
    } stream_out_type;

    void stream_out_init(stream_out_type *opt, char *out_buff, int out_buff_size, void (*out_func)(char *data, int len));

    void stream_out_reset(stream_out_type *opt);

    void stream_out_put_number(stream_out_type *opt, int number, int ipn, const char *prefix, const char *suffix);

    void stream_out_puts(stream_out_type *opt, const char *data);

    void stream_out_data(stream_out_type *opt, const char *data, int len);

    void stream_out_end(stream_out_type *opt);

    void stream_out_fmt(stream_out_type *opt, const char *fmt, ...);

#ifdef __cplusplus
} 
#endif 

#endif 
